<?php
declare (strict_types=1);

use think\facade\Route;

//miss路由，定义404
Route::miss(function () {
    @header("http/1.1 404 not found");
    @header("status: 404 not found");
    exit();
});

//首页
Route::group('index', function () {
    Route::get('/index', 'index/index');
    Route::get('/test', 'index/test');
    Route::get('/theme', 'index/theme');
    Route::get('/communal', 'index/communal');
    Route::get('/areaList', 'index/areaList');
    Route::get('/bankList', 'index/bankList');
    Route::get('/carouselList', 'index/carouselList');
    Route::get('/searchList', 'index/searchList');
    Route::post('/sendSms', 'index/sendSms');
    Route::get('/inquiryUser', 'index/inquiryUser');
    Route::get('/info', 'index/info');
    Route::get('/userMenu', 'index/userMenu');
});

//上传
Route::group('uploads', function () {
    Route::post('/image', 'uploads/image');
    Route::post('/video', 'uploads/video');
    Route::post('/file', 'uploads/file');
});

//公告
Route::group('news', function () {
    Route::get('/index', 'news/index');
    Route::get('/info', 'news/info');
});

//注册
Route::group('register', function () {
    Route::post('/index', 'register/index');
});

//登录
Route::group('login', function () {
    Route::post('/index', 'login/index');
    Route::post('/wechatAuth', 'login/wechatAuth');
    Route::post('/verifyCode', 'login/verifyCode');
});

//找回密码
Route::group('retrieve', function () {
    Route::post('/index', 'retrieve/index');
});

//安全中心
Route::group('security', function () {
    Route::get('/index', 'security/index');
    Route::post('/save', 'security/save');
})->middleware('verify');

//个人中心
Route::group('user', function () {
    Route::get('/index', 'user/index');
    Route::get('/info', 'user/info');
    Route::post('/edit', 'user/edit');
    Route::get('/myTeamTotal', 'user/myTeamTotal');
    Route::get('/myTeamList', 'user/myTeamList');
    Route::get('/myNodeList', 'user/myNodeList');
    Route::get('/getInvitationCode', 'user/getInvitationCode');

    Route::get('/myNodeList1', 'user/myNodeList1');
    Route::get('/myNodeList2', 'user/myNodeList2');
    Route::get('/myNodeList3', 'user/myNodeList3');
})->middleware('verify');

//账户相关
Route::group('account', function () {
    Route::get('/index', 'account/index');
    Route::get('/record', 'account/record');
})->middleware('verify');

//实名认证
Route::group('userAuth', function () {
    Route::get('/index', 'userAuth/index');
    Route::post('/save', 'userAuth/save');
})->middleware('verify');

//签到
Route::group('sign', function () {
    Route::get('/index', 'sign/index');
    Route::post('/add', 'sign/add');
})->middleware('verify');

//收货地址
Route::group('address', function () {
    Route::get('/index', 'address/index');
    Route::get('/info', 'address/info');
    Route::post('/save', 'address/save');
    Route::post('/setDefault', 'address/setDefault');
    Route::post('/delete', 'address/delete');
})->middleware('verify');

//收款方式
Route::group('method', function () {
    Route::get('/index', 'method/index');
    Route::get('/info', 'method/info');
    Route::post('/save', 'method/save');
})->middleware('verify');

//充值相关
Route::group('remit', function () {
    Route::get('/index', 'remit/index');
    Route::post('/save', 'remit/save');
    Route::get('/record', 'remit/record');
})->middleware('verify');

//提现相关
Route::group('draw', function () {
    Route::get('/index', 'draw/index');
    Route::post('/save', 'draw/save');
    Route::get('/record', 'draw/record');
})->middleware('verify');

//转账相关
Route::group('transfer', function () {
    Route::get('/index', 'transfer/index');
    Route::post('/save', 'transfer/save');
    Route::get('/record', 'transfer/record');
})->middleware('verify');

//转换相关
Route::group('exchange', function () {
    Route::get('/index', 'exchange/index');
    Route::post('/save', 'exchange/save');
    Route::get('/record', 'exchange/record');
})->middleware('verify');

//留言反馈相关
Route::group('message', function () {
    Route::get('/index', 'message/index');
    Route::post('/save', 'message/save');
})->middleware('verify');

//消息通知
Route::group('notify', function () {
    Route::get('/typeList', 'notify/typeList');
    Route::get('/index', 'notify/index');
})->middleware('verify');

//商品相关
Route::group('product', function () {
    Route::get('/cateList', 'product/cateList');
    Route::get('/index', 'product/index');
    Route::get('/info', 'product/info');
    Route::get('/getSpecInfo', 'product/getSpecInfo');
    Route::post('/submit', 'product/submit')->middleware('verify');
});

//购物车
Route::group('cart', function () {
    Route::get('/index', 'cart/index');
    Route::post('/add', 'cart/add');
    Route::post('/edit', 'cart/edit');
    Route::post('/submit', 'cart/submit');
})->middleware('verify');

//订单
Route::group('order', function () {
    Route::get('/getTemporary', 'order/getTemporary');
    Route::post('/submit', 'order/submit');
    Route::get('/payment', 'order/payment');
    Route::post('/confirmPayment', 'order/confirmPayment');
    Route::get('/index', 'order/index');
    Route::get('/info', 'order/info');
    Route::post('/edit', 'order/edit');
})->middleware('verify');

//拼团
Route::group('pintuan', function () {
    Route::post('/submit', 'pintuan/submit');
    Route::get('/myQianggou', 'pintuan/myQianggou');
    Route::get('/getQianggou', 'pintuan/getQianggou');
    Route::post('/subOrder', 'pintuan/subOrder');
})->middleware('verify');


//交易-线上
Route::group('tradeOnline', function () {
    Route::get('/index', 'tradeOnline/index');
    Route::get('/hallList', 'tradeOnline/hallList');
    Route::post('/save', 'tradeOnline/save');
    Route::get('/record', 'tradeOnline/record');
    Route::post('/revoke', 'tradeOnline/revoke');
    Route::post('/add', 'tradeOnline/add');
    Route::get('/myBuy', 'tradeOnline/myBuy');
    Route::get('/mySell', 'tradeOnline/mySell');
})->middleware('verify');

//交易-线下
Route::group('tradeOffline', function () {
    Route::get('/index', 'tradeOffline/index');
    Route::get('/hallList', 'tradeOffline/hallList');
    Route::post('/save', 'tradeOffline/save');
    Route::get('/record', 'tradeOffline/record');
    Route::post('/revoke', 'tradeOffline/revoke');
    Route::post('/add', 'tradeOffline/add');
    Route::get('/myBuy', 'tradeOffline/myBuy');
    Route::get('/buyInfo', 'tradeOffline/buyInfo');
    Route::get('/mySell', 'tradeOffline/mySell');
    Route::get('/sellInfo', 'tradeOffline/sellInfo');
    Route::post('/payment', 'tradeOffline/payment');
    Route::post('/receipt', 'tradeOffline/receipt');
    Route::post('/appeal', 'tradeOffline/appeal');
})->middleware('verify');

